<html>
<head><meta charset="utf-8"><title>io2 · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html">io2</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="185198593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185198593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185198593">(Jan 09 2020 at 10:13)</a>:</h4>
<p>I’ve been idly wondering if it would be worth introducing entirely new <code>Read</code> and <code>Write</code> traits, leaving the existing one alone in order to more easily make changes that are tricky to do backward-compatibly. Those changes include soundly reading into an uninitialized slice (cc <span class="user-mention" data-user-id="243558">@Steven Fackler</span>), existing in <code>libcore</code> (so not requiring <code>std::io::Error</code> which requires <code>Box</code> and <code>errno</code>), and perhaps others. These new APIs could live in an <code>io2</code> module (<code>std::io2</code> and <code>core::io2</code>).</p>



<a name="185198614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185198614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185198614">(Jan 09 2020 at 10:13)</a>:</h4>
<p>(I am however not volunteering to champion such a proposal.)</p>



<a name="185212344"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185212344" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185212344">(Jan 09 2020 at 13:41)</a>:</h4>
<p>That definitely is an option, but it'd be so disruptive that I think we'd need a <em>really</em> good reason to do it. The uninitialized buffer stuff can be added in a pretty clean way to the existing trait so I don't know if it's worth it.</p>



<a name="185212594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185212594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185212594">(Jan 09 2020 at 13:44)</a>:</h4>
<p>It would indeed be disruptive and probably no individual change alone is worth that. But maybe together?</p>



<a name="185239745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185239745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185239745">(Jan 09 2020 at 18:17)</a>:</h4>
<p>Having read and write traits in core is a very good thing.</p>



<a name="185239779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185239779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185239779">(Jan 09 2020 at 18:17)</a>:</h4>
<p>they don't need to be complete replacements for existing read and write though</p>



<a name="185239895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185239895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185239895">(Jan 09 2020 at 18:18)</a>:</h4>
<p>an ideal situation would be if a subset of current read/write could be extracted and put in a sub trait in core, and then std read and write extend that with all the stuff</p>



<a name="185239949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185239949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185239949">(Jan 09 2020 at 18:19)</a>:</h4>
<p>and all that would be totally orthogonal to adding new methods for uninit memory or not</p>



<a name="185241294"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185241294" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Simon Sapin <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185241294">(Jan 09 2020 at 18:34)</a>:</h4>
<blockquote>
<p>an ideal situation would be if a subset of current read/write could be extracted and put in a sub trait in core</p>
</blockquote>
<p>But they can’t, because <code>std::io::Error</code>.</p>



<a name="185241579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185241579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185241579">(Jan 09 2020 at 18:37)</a>:</h4>
<p>well, then i guess we'll need io2 eventually</p>



<a name="185243146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185243146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Steven Fackler <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185243146">(Jan 09 2020 at 18:54)</a>:</h4>
<p>or a merge of core and std</p>



<a name="185250220"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/io2/near/185250220" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/io2.html#185250220">(Jan 09 2020 at 20:08)</a>:</h4>
<p>Maybe.</p>
<p>std error needs to be in std because of having os awareness and possible allocating and such, but the point of having core reading and writing is to make your code be totally agnostic to things like that, and even support no OS and no allocation.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>